import type { GoodsItem, PageParams, PageResult } from '@/types/global'
import type { GetHomeBannerItem, GetHomeCategoryMutliItem, GetHomeHotMutliItem } from '@/types/home'
import { request } from '@/utils/request'
/**
 * 获取首页轮播图
 * @returns 轮播图列表
 */
export const getHomeBannerAPI = (distributionSite: number) => {
  return request<GetHomeBannerItem[]>('/home/banner', 'GET', {
    distributionSite
  })
}
/**
 * 获取首页前台分类
 * @returns 前台分类列表
 */
export const getHomeCategoryMutliAPI = () => {
  return request<GetHomeCategoryMutliItem[]>('/home/category/mutli', 'GET')
}
// 首页-热门推荐-小程序
// GET
// /home/hot/mutli
export const getHomeHotMutliAPI = () => {
  return request<GetHomeHotMutliItem[]>('/home/hot/mutli', 'GET')
}

// 猜你喜欢-小程序
// GET
// /home/goods/guessLike
export const getHomeGoodsGuessLikeAPI = (params: PageParams) => {
  return request<PageResult<GoodsItem>>('/home/goods/guessLike', 'GET', params)
}
